home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue54 / CCorn / Publisher_TLB.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-01-10  |  5.7 KB  |  119 lines

  1. unit Publisher_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING                                                                    
  5. // -------                                                                    
  6. // The types declared in this file were generated from data read from a       
  7. // Type Library. If this type library is explicitly or indirectly (via        
  8. // another type library referring to this type library) re-imported, or the   
  9. // 'Refresh' command of the Type Library Editor activated while editing the   
  10. // Type Library, the contents of this file will be regenerated and all        
  11. // manual modifications will be lost.                                         
  12. // ************************************************************************ //
  13.  
  14. // PASTLWTR : $Revision:   1.88  $
  15. // File generated on 1/10/2000 7:29:20 PM from Type Library described below.
  16.  
  17. // *************************************************************************//
  18. // NOTE:                                                                      
  19. // Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties  
  20. // which return objects that may need to be explicitly created via a function 
  21. // call prior to any access via the property. These items have been disabled  
  22. // in order to prevent accidental use from within the object inspector. You   
  23. // may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively   
  24. // removing them from the $IFDEF blocks. However, such items must still be    
  25. // programmatically created via a method of the appropriate CoClass before    
  26. // they can be used.                                                          
  27. // ************************************************************************ //
  28. // Type Lib: C:\My Documents\DelphiMag\Feb00\Events\Publisher.dll (1)
  29. // IID\LCID: {AA2DE465-7760-4952-BB63-D2970577299E}\0
  30. // Helpfile: 
  31. // DepndLst: 
  32. //   (1) v2.0 stdole, (C:\WINNT\System32\stdole2.tlb)
  33. // Parent TypeLibrary:
  34. //   (0) v1.0 Subscriber, (C:\My Documents\DelphiMag\Feb00\Events\Subscriber.tlb)
  35. // ************************************************************************ //
  36. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
  37. interface
  38.  
  39. uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;
  40.  
  41. // *********************************************************************//
  42. // GUIDS declared in the TypeLibrary. Following prefixes are used:        
  43. //   Type Libraries     : LIBID_xxxx                                      
  44. //   CoClasses          : CLASS_xxxx                                      
  45. //   DISPInterfaces     : DIID_xxxx                                       
  46. //   Non-DISP interfaces: IID_xxxx                                        
  47. // *********************************************************************//
  48. const
  49.   // TypeLibrary Major and minor versions
  50.   PublisherMajorVersion = 1;
  51.   PublisherMinorVersion = 0;
  52.  
  53.   LIBID_Publisher: TGUID = '{AA2DE465-7760-4952-BB63-D2970577299E}';
  54.  
  55.   IID_IEventObj: TGUID = '{AAC2C890-9CF2-4B45-9163-8A536E103982}';
  56.   CLASS_EventObj: TGUID = '{3463A43E-6205-46C6-94D2-B029E6D02809}';
  57. type
  58.  
  59. // *********************************************************************//
  60. // Forward declaration of types defined in TypeLibrary                    
  61. // *********************************************************************//
  62.   IEventObj = interface;
  63.   IEventObjDisp = dispinterface;
  64.  
  65. // *********************************************************************//
  66. // Declaration of CoClasses defined in Type Library                       
  67. // (NOTE: Here we map each CoClass to its Default Interface)              
  68. // *********************************************************************//
  69.   EventObj = IEventObj;
  70.  
  71.  
  72. // *********************************************************************//
  73. // Interface: IEventObj
  74. // Flags:     (4416) Dual OleAutomation Dispatchable
  75. // GUID:      {AAC2C890-9CF2-4B45-9163-8A536E103982}
  76. // *********************************************************************//
  77.   IEventObj = interface(IDispatch)
  78.     ['{AAC2C890-9CF2-4B45-9163-8A536E103982}']
  79.     function  MyEvent(const EventParam: WideString): HResult; safecall;
  80.   end;
  81.  
  82. // *********************************************************************//
  83. // DispIntf:  IEventObjDisp
  84. // Flags:     (4416) Dual OleAutomation Dispatchable
  85. // GUID:      {AAC2C890-9CF2-4B45-9163-8A536E103982}
  86. // *********************************************************************//
  87.   IEventObjDisp = dispinterface
  88.     ['{AAC2C890-9CF2-4B45-9163-8A536E103982}']
  89.     function  MyEvent(const EventParam: WideString): HResult; dispid 1;
  90.   end;
  91.  
  92. // *********************************************************************//
  93. // The Class CoEventObj provides a Create and CreateRemote method to          
  94. // create instances of the default interface IEventObj exposed by              
  95. // the CoClass EventObj. The functions are intended to be used by             
  96. // clients wishing to automate the CoClass objects exposed by the         
  97. // server of this typelibrary.                                            
  98. // *********************************************************************//
  99.   CoEventObj = class
  100.     class function Create: IEventObj;
  101.     class function CreateRemote(const MachineName: string): IEventObj;
  102.   end;
  103.  
  104. implementation
  105.  
  106. uses ComObj;
  107.  
  108. class function CoEventObj.Create: IEventObj;
  109. begin
  110.   Result := CreateComObject(CLASS_EventObj) as IEventObj;
  111. end;
  112.  
  113. class function CoEventObj.CreateRemote(const MachineName: string): IEventObj;
  114. begin
  115.   Result := CreateRemoteComObject(MachineName, CLASS_EventObj) as IEventObj;
  116. end;
  117.  
  118. end.
  119.